import { reactArray, reactArrayWithUndefined, reactJson, reactJsonWithUndefined } from 'xbsj-base';
import { CzmClippingPlaneCollectionJsonType, CzmClippingPolygonCollectionJsonType, CzmSceneGlobeShadowsType, CzmSceneSkyBoxSourcesType } from '../ESJTypesCzm';
import { ESCesiumViewer } from './index';
export * from './Flattern';
export * from './ViewerExtensions';

export const createBaseProps = () => ({
    // 通用
    createCesiumViewerFuncStr: undefined as string | undefined,
    flashLighting: undefined as boolean | undefined, // 头顶光
    // Viewer
    resolutionScale: undefined as number | undefined,
    msaaSamples: undefined as number | undefined,
    shadows: false,
    // Viewer Scene
    // 位置分割
    sceneSplitPosition: undefined as number | undefined,
    // Viewer Scene Globe
    depthTestAgainstTerrain: undefined as boolean | undefined,
    sceneGlobeShadows: undefined as CzmSceneGlobeShadowsType | undefined,

    sceneGlobeTerrainExaggeration: 1,
    sceneGlobeTerrainExaggerationRelativeHeight: 0,
    sceneGlobeVerticalExaggeration: 1,
    sceneGlobeVerticalExaggerationRelativeHeight: 0,

    sceneGlobeBackFaceCulling: true,
    sceneGlobeShowSkirts: true,
    sceneGlobeShowWaterEffect: true,
    sceneGlobeBaseColor: reactArray<[number, number, number, number]>([0, 0, 1, 0]),
    sceneGlobeCartographicLimitRectangle: reactArray<[number, number, number, number]>([-180, -90, 180, 90]),
    sceneGlobeClippingPlanes: reactJson<CzmClippingPlaneCollectionJsonType | undefined>(undefined),
    sceneGlobeClippingPlanesId: '',
    sceneGlobeClippingPolygons: reactJsonWithUndefined<CzmClippingPolygonCollectionJsonType>(undefined),
    sceneGlobeClippingPolygonsId: reactArray<string[]>([]),

    // Viewer Scene Globe UnderGround
    sceneGlobeUndergroundColor: reactArrayWithUndefined<[number, number, number, number] | undefined>(undefined),
    sceneGlobeUndergroundColorAlphaByDistance: reactArrayWithUndefined<[number, number, number, number] | undefined>(undefined),
    // Viewer Scene Globe Translucency
    sceneGlobeTranslucencyEnabled: undefined as boolean | undefined,
    sceneGlobeTranslucencyBackFaceAlpha: undefined as number | undefined,
    sceneGlobeTranslucencyBackFaceAlphaByDistance: reactArrayWithUndefined<[number, number, number, number] | undefined>(undefined),
    sceneGlobeTranslucencyFrontFaceAlpha: undefined as number | undefined,
    sceneGlobeTranslucencyFrontFaceAlphaByDistance: reactArrayWithUndefined<[number, number, number, number] | undefined>(undefined),
    sceneGlobeTranslucencyRectangle: reactArrayWithUndefined<[number, number, number, number] | undefined>(undefined),
    // Viewer Scene Sun
    sun: undefined as boolean | undefined,//太阳//TODO:ue无
    sceneSunGlowFactor: undefined as number | undefined,
    // Viewer Scene Moon
    moon: undefined as boolean | undefined,//TODO:ue无
    sceneMoonTextureUrl: undefined as string | undefined,
    sceneMoonOnlySunLighting: undefined as boolean | undefined,
    // moonEllipsoid: undefined as [x: number, y: number, z: number] | undefined,//属性为只读属性，无法分配 //TODO
    // Viewer Scene SkyBox
    sceneSkyBoxShow: true,
    sceneSkyBoxSources: reactJson<CzmSceneSkyBoxSourcesType>(ESCesiumViewer.defaults.sceneSkyBoxSources),
    xbsjUseBackground: false,
    xbsjBackgroundImageUri: '',
    xbsjBackgroundColor: reactArray<[number, number, number, number]>([1, 1, 1, 1]),
    xbsjLocalBoxSources: reactJsonWithUndefined<CzmSceneSkyBoxSourcesType>(undefined),
    sceneBackgroundColor: reactArray<[number, number, number, number]>([0, 0, 0, 0]),
    // Viewer Scene Fog
    sceneFogEnabled: undefined as boolean | undefined,
    sceneFogDensity: undefined as number | undefined,
    sceneFogScreenSpaceErrorFactor: undefined as number | undefined,
    sceneFogMinimumBrightness: undefined as number | undefined,
    // fogRenderable: true as boolean,//fog上不存在该属性 //todo
    // Viewer Scene Sscc
    sceneSsccEnableInputs: undefined as boolean | undefined,
    sceneSsccEnableCollisionDetection: undefined as boolean | undefined,
    sceneSsccZoomFactor: undefined as number | undefined, // g_app.czmViewer.viewer.scene.screenSpaceCameraController._zoomFactor = 2
    // Viewer Scene Camera
    // sceneCameraFrustumFov: 90,// TODO:上层已有属性fov
    // Viewer Scene Pps
    scenePpsfxaaEnabled: undefined as boolean | undefined,
    // scenePpsAmbientOcclusion
    scenePpsAmbientOcclusionEnabled: false,
    scenePpsAmbientOcclusionAmbientOcclusionOnly: false,
    scenePpsAmbientOcclusionIntensity: 3.0,
    scenePpsAmbientOcclusionBias: 0.1,
    scenePpsAmbientOcclusionLengthCap: 0.03,
    scenePpsAmbientOcclusionStepSize: 1.0,
    scenePpsAmbientOcclusionBlurStepSize: 0.86,
    // scenePpsBloom
    scenePpsBloomEnabled: false,
    scenePpsBloomGlowOnly: false,
    scenePpsBloomContrast: 128,
    scenePpsBloomBrightness: -0.3,
    scenePpsBloomDelta: 1.0,
    scenePpsBloomSigma: 3.78,
    scenePpsBloomStepSize: 5.0,
    // Viewer Scene Debug
    // debugCommandFilter
    sceneDebugShowFramesPerSecond: undefined as boolean | undefined,
    sceneDebugShowCommands: undefined as boolean | undefined,
    sceneDebugShowFrustums: undefined as boolean | undefined,
    sceneDebugShowFrustumPlanes: undefined as boolean | undefined,
    sceneDebugShowDepthFrustum: undefined as number | undefined,
    // Viewer Inspector
    showCesiumInspector: undefined as boolean | undefined,
    cesiumInspectorWireframe: undefined as boolean | undefined,
    showCesium3DTilesInspector: undefined as boolean | undefined,

    // firstPersonKeyboardEnabled: false,
    // firstPersonMouseEnabled: false,
    // firstPersonWalkingSpeed: 1,
    // firstPersonRotatingSpeed: 0.01,
    // firstPersonAlwaysWithCamera: false,
    // firstPersonKeyStatusMap: reactJson<{ [k: string]: CzmCameraActionType }>(KeyboardCameraController.defaultKeyStatusMap),
});



